<?php

namespace App\Models;

class Tag extends Model
{
    protected $fillable = ['name'];

    public function tagMaps()
    {
        $this->hasMany(TagMap::class);
    }

    public function getTags()
    {
        return $this->orderBy('hot','desc')->select()->get();
    }

    public function getTag($tags)
    {
        $tagsA =  $this->whereIn('id',  explode(',',$tags))
            ->get();
        return $tagsA;
    }
}
